<?php
  //Genesis Software Manual - Page 17

  $pdf->AddPage();
  //$pdf->Image('./Genesis/Gen-soft/Gsm-10.png',0,0,210 ,297);
  //add_raster(1);

  $pdf->SetDrawColor(0,0,0);
  $pdf->SetTextColor(0,0,0);
  $pdf->SetFont('arial','',10);
  $pdf->SetLineWidth(0.4);
  set_text_space(4.4);
 
  $margin = array
  (
    'tab_1' => 30,
    'tab_2' => 37,
    'tab_3' => 44
  );
  
  new_line(30);

  $pdf->Bookmark('3. External Interrupt (EX-INT)',2,current_line() - 10);
  $pdf->Text($margin['tab_2'],current_line(),'3.');
  $pdf->Text($margin['tab_3'],current_line(),'EXTERNAL INTERRUPT (EX-INT)');
  $pdf->SetFont('arial','',10);
  
  new_line();
  new_line();

  $pdf->Text($margin['tab_3'],current_line(),'The external interrupt is generated by a peripheral device (gun, modem) and stops the H, V');
  $pdf->Text($margin['tab_3'],new_line(),'counter for later examination by the CPU.');
  
  //Figure 1 --- Cleanup later
  $fig_x = $margin['tab_3'];
  $fig_y = current_line() + 12;
  
  $pdf->Text($fig_x,$fig_y,'HL INPUT PIN');
    $pdf->Line($margin['tab_3'] - 7,current_line() + 14,$margin['tab_3'] + 30,current_line() + 14);
    $pdf->Line($margin['tab_3'] + 30,current_line() + 14,$margin['tab_3'] + 30,current_line() + 14 + 7);
    $pdf->Line($margin['tab_3'] + 30,current_line() + 14 + 7,$margin['tab_3'] + 30 + 80,current_line() + 14 + 7);
    $pdf->Text($margin['tab_3'] + 31,current_line() + 31,'INTERRUPT HAPPEN (COUNTER RATCHED)');
    //draw little arrow
    $pdf->Line($fig_x + 31,$fig_y + 15,$fig_x + 32,$fig_y + 13);
    $pdf->Line($fig_x + 32,$fig_y + 13,$fig_x + 33,$fig_y + 15);
    $pdf->Line($fig_x + 31,$fig_y + 15,$fig_x + 33,$fig_y + 15);
  
  new_line(84);
    $pdf->Text($margin['tab_3'],current_line(),'Please see other sections of this manual for information about the H, V counter and the');
    $pdf->Text($margin['tab_3'],new_line(),'initialization of the external interrupt');
  
  new_line(101);
  $pdf->SetFont('arial','B',10);

  $pdf->Bookmark('E. VDP Port',1,current_line() - 10);
  $pdf->Text($margin['tab_1'],current_line(),'E.');
  $pdf->Text($margin['tab_2'],current_line(),'VDP PORT');
  $pdf->SetFont('arial','',10);
  new_line();
  new_line();
  $pdf->Text($margin['tab_2'],current_line(),'The VDP ports are at location 68000 in the 68000 memory space');


  //Table 1
  $table_x = $margin['tab_3'] + 25;
  set_text_space(3.8);

  new_line(122);
    gentab_Start(0,$table_x,55);
    $half_width = ($gen_tables[0]['width'] / 2);
    gentab_CenterText(0,'UPPER BYTE',0,$half_width);
    gentab_CenterText(0,'LOWER BYTE',$half_width,$half_width);
  new_line();
    //Reset table to start at correct position
    gentab_Start(0,$table_x,55,25);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 0','L');
    gentab_CenterText(0,'DATA PORT');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 2','L');
    gentab_CenterText(0,'"');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 4','L');
    gentab_CenterText(0,'CONTROL PORT');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 6','L');
    gentab_CenterText(0,'"');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 8','L');
    gentab_CenterText(0,'HV COUNTER');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 A','L');
    gentab_CenterText(0,'PROHIBITED');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 C','L');
    gentab_CenterText(0,'PROHIBITED');
  new_line();
    gentab_Line(0);
  new_line();
    gentab_Text(0,'$ C 0 0 0 0 E','L');
    gentab_CenterText(0,'PROHIBITED');
  new_line();
    gentab_Line(0);
    $vertical_start = current_line();
    gentab_VerLine_Start(0,0,$half_width);
  new_line();
    gentab_Text(0,'$ C 0 0 0 1 0','L');
    gentab_CenterText(0,'PROHIBITED',0,$half_width);
    gentab_CenterText(0,'PSG',$half_width,$half_width);
  new_line();
    gentab_VerLine_End(0,0);
 
  gentab_End(0);  


  new_line(204);
  set_text_space(4.4);

  $pdf->Bookmark('1. $C00000 (Data Port)',2,current_line() - 10);
  $pdf->Text($margin['tab_2'],current_line(),'1.');
  $pdf->Text($margin['tab_3'],current_line(),'$C 0 0 0 0 0 (Data Port)');
  $pdf->SetFont('arial','',10);

  new_line();
  new_line();

  $pdf->Text($margin['tab_3'],current_line(),'READ/WRITE: VRAM, VSRAM, CRAM');
  
  new_line();
  new_line();

  bit_field_table($margin['tab_3'] +1,current_line() - 3,15.4,7,
    array('DT15','DT14','DT13','DT12','DT11','DT10','DT9','DT8'));
  bit_field_table($margin['tab_3'] +1 + (15.4 / 2),current_line() - 3 + 7,15.4,7,
    array('DT7','DT6','DT5','DT4','DT3','DT2','DT1','DT0'));
  
  caption_16_bit_field($margin['tab_3'],190,'$ C 0 0 0 0 0');
  
  new_line(237);
  $pdf->SetFont('arial','',10);
  $pdf->Text($margin['tab_3'],current_line(),'* $C00000 and $C00002 are functionally equivalent.');

  
  
  add_footer($pdf,'02/19/92','10');

?>
